- name: install fedmsg-gateway
  yum: pkg=fedmsg-gateway state=present
  tags:
  - packages
  - fedmsg/gateway

- name: ensure that nrpe has rights to monitor us
  file: >
    dest=/var/run/fedmsg/monitoring-fedmsg-gateway.socket
    mode=0775
    owner=fedmsg
    group=nrpe
    state=file
  ignore_errors: true

- name: enable on boot and start fedmsg-gateway
  service: name=fedmsg-gateway state=started enabled=true
  tags:
  - services
  - fedmsg/gateway
  notify:
  - restart fedmsg-gateway

- name: setup fedmsg-gateway config file
  copy: src=gateway.py dest=/etc/fedmsg.d/gateway.py
  tags:
  - config
  - fedmsg/gateway
  notify:
  - restart fedmsg-gateway

- name: bump fs limits by installing our own systemd service file
  copy: >
    src=fedmsg-gateway.service
    dest=/usr/lib/systemd/system/fedmsg-gateway.service
  tags:
  - config
  - fedmsg/gateway
  notify:
  - restart fedmsg-gateway
